//
//  EFALoginModel.m
//  efairy
//
//  Created by XiangDongMBP on 2017/7/26.
//  Copyright © 2017年 East. All rights reserved.
//

#import "EFALoginModel.h"

@implementation EFALoginUserInfo
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }
- (NSString *)efairyrole_name {
    NSArray *array = @[@"超级管理员", @"总监+", @"总监", @"项目管理员", @"普通用户"];
    if (self.efairyrole_level < array.count) {
        return array[self.efairyrole_level];
    }
    return @"无效角色";
}
- (NSString *)efairyuser_nickname {
    return _efairyuser_nickname ? _efairyuser_nickname : @"";
}
- (NSString *)efairyuser_company {
    return _efairyuser_company ? _efairyuser_company : @"";
}
- (NSString *)efairyuser_company_address {
    return _efairyuser_company_address ? _efairyuser_company_address : @"";
}
- (NSString *)efairyuser_email {
    return _efairyuser_email ? _efairyuser_email : @"";
}
- (NSString *)efairyuser_phonenumber {
    return _efairyuser_phonenumber ? _efairyuser_phonenumber : @"";
}
- (NSString *)efairyuser_device_supplier {
    return _efairyuser_device_supplier ? _efairyuser_device_supplier : @"";
}
@end
@implementation EFALoginModel
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }

- (NSString *)roleNameWithRoleId:(NSInteger)roleId {
    NSArray *array = @[@"超级管理员", @"总监+", @"总监", @"项目管理员", @"普通用户"];
    if (roleId < array.count) {
        return array[roleId];
    }
    return nil;
}
@end
